export const servantStateEnum = (state = '') => { // 服务者
  switch (state) {
    case -2:
      return '账号锁定'
    case 0:
      return '资料为空'
    case 1:
      return '等待审核'
    case 2:
      return '审核驳回'
    case 3:
      return '审核通过'
    default:
      return '-'
  }
}

export const questionTypeEnum = (state = '') => { // 试题
  switch (state) {
    case 1:
      return '单选题'
    case 2:
      return '填空题'
    case 3:
      return '判断题'
    case 4:
      return '多选题'
    case 5:
      return '简答题'
    default:
      return '-'
  }
}

export const NumToLetter = (index = 0) => { // 将数字转换为字母
  const letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
  if (typeof index === 'number') {
    index = Math.abs(index)
    if (index >= 0 && index < 26) {
      return letters[index]
    } else {
      return `${letters[index % 26]}${Math.floor((index / 26))}`
    }
  } else {
    console.error('Parameter is not a number！')
  }
}

export const NumToLetters = { // 将数字转换为字母(获取大小写)
  upper (index) {
    return NumToLetter(index).toUpperCase()
  },
  lower (index) {
    return NumToLetter(index).toLowerCase()
  }
}
export const ExamTestPaperStateEnum = (state = '') => { // 试卷状态
  switch (state) {
    case '':
      return '全部'
    case 0:
      return '未发布'
    case 1:
      return '已发布'
    default:
      return '-'
  }
}

export const ExamTestPaperTypeEnum = (state = '') => { // 试卷类型
  switch (state) {
    case 1:
      return '模拟试卷'
    case 2:
      return '正规试卷'
    default:
      return '-'
  }
}

export const ExamTestPaperSubTypeEnum = (state = '') => { // 试卷分类
  switch (state) {
    case 1:
      return '预测试题'
    case 2:
      return '历年真题'
    case 3:
      return '模拟题'
    case 4:
      return '常规练习'
    case 5:
      return '章节练习'
    default:
      return '-'
  }
}

export const ExamTestPaperQuestionAddTypeEnum = (state = '') => { // 试题添加方式
  switch (state) {
    case 1:
      return '随机添加'
    case 2:
      return '手动添加'
    default:
      return '-'
  }
}

export const courseStudyTypeEnum = (state = '') => { // 课程授课方式
  switch (state) {
    case 1:
      return '网授课程'
    case 2:
      return '面授课程'
    case 3:
      return '直播课程'
    default:
      return '-'
  }
}

export const coursePreviewTypeEnum = (state = '') => { // 课程预览类型
  switch (state) {
    case 1:
      return '视频'
    case 2:
      return '图片'
    default:
      return '-'
  }
}

export const timeUnitEnum = (state = '') => { // 时间单位
  switch (state) {
    case 0:
      return '不限制时间'
    case 1:
      return '年'
    case 2:
      return '月'
    case 3:
      return '日'
    case 4:
      return '小时'
    case 5:
      return '分钟'
    default:
      return '-'
  }
}

export const shopProxyCourseStateEnum = (state = '') => { // 代理中课程状态
  switch (state) {
    case -2:
      return '已删除'
    case -1:
      return '拒绝通过'
    case 0:
      return '等待审核'
    case 1:
      return '审核通过'
    default:
      return '全部'
  }
}

export const shopProxyCourseStateTagNameEnum = (state = '') => { // 代理中课程状态标签样式
  switch (state) {
    case 666:
      return 'info'
    case -2:
      return 'info'
    case -1:
      return 'danger'
    case 0:
      return ''
    case 1:
      return 'success'
    default:
      return '-'
  }
}

export const missionStateEnum = (state = '') => { // 任务状态
  switch (state) {
    case -2:
      return '已作废'
    case -1:
      return '已取消'
    case 0:
      return '任务生成'
    case 1:
      return '已出发'
    case 2:
      return '已到达'
    case 3:
      return '开始服务'
    case 4:
      return '完成服务'
    case 5:
      return '完成评价'
    case 6:
      return '已结算'
    case 7:
      return '投诉中'
    default:
      return '-'
  }
}

export const complaintStateEnum = (state = '') => { // 投诉状态
  switch (state) {
    case -1:
      return '已取消'
    case 0:
      return '等待申述'
    case 1:
      return '等待审核'
    case 2:
      return '投诉成功'
    case 3:
      return '投诉失败'
    default:
      return '-'
  }
}

export const withdrawStateEnum = (state = '') => { // 提现状态
  switch (state) {
    case -1:
      return '已驳回'
    case 0:
      return '待审核'
    case 1:
      return '待转账'
    case 2:
      return '已完成'
    default:
      return '-'
  }
}

export const userStateEnum = (state = '') => { // 用户状态
  switch (state) {
    case -2:
      return '锁定'
    case -1:
      return '已删除'
    case 0:
      return '待审核'
    case 1:
      return '正常'
    default:
      return '-'
  }
}

export const reserveServiceUseTypeEnum = (state = '') => { // 服务预约类型
  switch (state) {
    case 1:
      return '上门服务'
    case 2:
      return '在线咨询'
    case 3:
      return '商户服务'
    case 4:
      return '挂号'
    case 5:
      return '点播课程'
    default:
      return '-'
  }
}

export const orderTypeEnum = (state = '') => { //  订单类型
  switch (state) {
    case 1:
      return '服务包'
    case 2:
      return '商户课程'
    case 3:
      return '挂号'
    case 4:
      return '活动'
    case 5:
      return '拼团'
    case 6:
      return '服务人员课程'
    default:
      return '-'
  }
}

export const orderStateEnum = (state = '') => { //  订单状态
  switch (state) {
    case 0:
      return '已创建'
    case 1:
      return '已支付'
    case 2:
      return '已完成'
    case 3:
      return '已取消'
    default:
      return '-'
  }
}

export const articleStateEnum = (state = '') => { // 文章状态
  switch (state) {
    case 1:
      return ''
    case 2:
      return '待审核'
    case 3:
      return '已通过'
    case 4:
      return '已驳回'
    default:
      return '-'
  }
}

export const MassMessageStateEnum = (state = '') => { // 群发推送状态
  switch (state) {
    case 1:
      return '待审核'
    case 2:
      return '已通过'
    case 3:
      return '已驳回'
    case 4:
      return '取消'
    default:
      return '-'
  }
}

export const MassMessageTypeEnum = (state = '') => { // 群发推送类型
  switch (state) {
    case 0:
      return '文章'
    case 1:
      return '服务包'
    case 2:
      return 'xxx'
    default:
      return '-'
  }
}

export const SettlementStateEnum = (state = '') => { // 结算单状态
  switch (state) {
    case -1:
      return '已驳回'
    case 0:
      return '可申请'
    case 1:
      return '待审核'
    case 2:
      return '已通过'
    default:
      return '全部'
  }
}

export const DevideBindDetailServiceTypeEnum = (state = '') => { // 分成方案绑定详请服务类型
  switch (state) {
    case 1:
      return '服务'
    case 2:
      return '课程'
    case 3:
      return '挂号'
    case 6:
      return '服务者课程'
    default:
      return '-'
  }
}

export const ActivityStateEnum = (state = '') => { // 活动状态
  switch (state) {
    case -3:
      return '已暂停'
    case -1:
      return '已拒绝'
    case 0:
      return '待审核'
    case 1:
      return '已通过'
    default:
      return '-'
  }
}

export const UserReserveServiceStateEnum = (state = '') => { // 任务预约状态
  switch (state) {
    case -2:
      return '服务者已取消'
    case -1:
      return '用户已取消'
    case 0:
      return '待确认'
    case 1:
      return '已确认'
    default:
      return '-'
  }
}

export const MissionStateEnum = (state = '') => { // 任务状态
  switch (state) {
    case -2:
      return '已作废'
    case -1:
      return '已取消'
    case 0:
      return '已生成'
    case 1:
      return '已出发'
    case 2:
      return '已到达'
    case 3:
      return '开始服务'
    case 4:
      return '完成服务'
    case 5:
      return '完成评价'
    case 6:
      return '已结算'
    case 7:
      return '投诉中'
    default:
      return '-'
  }
}
